package com.yami.shop.personnft.common.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yami.shop.common.serializer.json.ImgJsonSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 申购记录对象 t_subscribe_record
 *
 * @author zhangchaoqun
 * @date 2021-10-13
 */
@Schema(description ="划转申请")
@Data
@TableName("tz_subscribe_record")
public class SubscribeRecord implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 32位UUID
     */
    private String id;

    /**
     * 用户userid
     */
    private String userId;
    /**
     * 商品id
     */
    private Long productId;

    /**
     * 申请单价
     */
    private BigDecimal subPrice;

    /**
     * 申请数量
     */
    private Integer subCount;

    /**
     * =申购数量*申购单价
     */
    private BigDecimal subAmount;

    /**
     * 实际成交数量
     */
    private Integer actualCount;

    /**
     * 实际金额
     */
    private BigDecimal actualAmount;

    /**
     * 申请手续费
     */
    private BigDecimal subCommissio;

    /**
     * 支付方式 1 商城余额 2 恒生资金
     */
    @TableField(exist = false)
    private Integer type;

    @TableField(exist = false)
    private String payPassword;

    /**
     * 申购时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date subTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 实际手续费
     */
    private BigDecimal  actualCommissio;


    private String settleAccount;


    //用于判断是否申购成功 1已申请 2成功（分到卡） 3申购失败 5取消  //4包含2和3 即入参查询分配结束的记录  //6 包含 1或5
    private Integer subscribeRecordStatus;

    private String cancelReason;

    private Long shopId;

    private BigDecimal subAmountAndSubCommissio;
    private BigDecimal actualAmountAndActualCommissio;
    private BigDecimal cancelAmountAndCancelCommissio;

    private String mallName;
    private String shopName;
    private String shopLogo;

    private String productName;
    @JsonSerialize(using = ImgJsonSerializer.class)
    private String productPic;

    private String partyCode;
    private String nickName;

    private Long issueTotal;

    private Date openTime;

    private Integer maxCount;

    private String orderNumber;

    private Integer batchId;

    private Integer pubOnceCount;
}
